import os
import uiautomation
from config.config import DATA_PATH
from page.index import IndexPage
from page.门诊护士站.menzhenhushizhan__page import menzhenhushizhan
from tools.sjqd_way import read_data_from_excel

class Tiaoshi():
    his = uiautomation.WindowControl(searchDepth=1, Name='科玛奇医院信息管理系统')  # 锁定窗口
    his.SetFocus()
    def menzhenhushizhan_xiugaishimin(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "测试患者")
        name = self.data[0][0]
        ap = IndexPage()
        bp = menzhenhushizhan()
        ap.click_mzhsz1_btn()  # 点击门诊护士站
        ap.click_mzhsz2_btn()  # 点击门诊护士站
        bp.input_xm(name)
        bp.click_yzx_btn()#点击已执行按钮
        bp.click_sm_xxk()  # 点击试敏选项卡
        bp.click_cx_btn()#点击查询按钮
        bp.click_sj1_btn()  # 点击数据1标头
        bp.click_smxg_btn()#点击试敏修按钮
        bp.click_smjg1()  # 点击试敏结果1
        bp.click_smjg2()  # 点击试敏结果2
        bp.click_smjg3()  # 点击试敏结果3
        bp.click_smjg4()  # 点击试敏结果4
        bp.click_smjg5()  # 点击试敏结果5
        bp.click_xgsmqd_btn()#点击修改试敏结果确定按钮
if __name__ == '__main__':
    Tiaoshi().menzhenhushizhan_xiugaishimin()
